package com.example.common.entity.mq;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDate;

/**
 * <p>
 *     mq消息保存实体
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@Setter
@Getter
@Accessors(chain = true)
@TableName("mq_message")
public class MqMessageEntity {

    /**
     * 自定义ID
     */
    @TableId(type = IdType.INPUT)
    private String messageId;

    private String content;

    private String toExchange;

    private String routingKey;

    private String classType;

    /**
     * 0: 新建 1：已发送 2：错误抵达 3：已抵达
     */
    private Integer messageStatus;

    private LocalDate createTime;

    private LocalDate updateTime;

    /**
     * 保存失败的原因
     */
    private String reason;


    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
